package com.xingshang.controller;


import com.xingshang.pojo.FavoriteSong;
import com.xingshang.service.FavoriteSongService;
import com.xingshang.utils.JwtHelper;
import com.xingshang.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("likeSong")
public class LikeSongController {

    @Autowired
    private JwtHelper jwtHelper;

    @Autowired
    private FavoriteSongService favoriteSongService;

    @PostMapping("")
    public Result addLikeSong(@RequestHeader String token, @RequestBody FavoriteSong favoriteSong) {
        return favoriteSongService.addLike(token, favoriteSong);
    }

    @GetMapping("")
    public Result getLikeSong(@RequestHeader String token, @RequestParam String mid) {
        return favoriteSongService.getLikeSongByMid(token,mid);
    }

    @GetMapping("list")
    public Result getLikeSongList(@RequestHeader String token) {
        return favoriteSongService.getLikeSongList(token);
    }
}
